var host = "https://www.easy-mock.com/mock/5cef9dcbd23d734d42a630ae/song/"

function request(url, postData, doSuccess, doFail) {
  console.log(url)
  wx.request({
    //项目的真正接口，通过字符串拼接方式实现
    url: host + url,
    header: {
      "content-type": "application/json;charset=UTF-8"
    },
    data: postData,
    method: 'POST',
    success: function (res) {
      //参数值为res.data,直接将返回的数据传入
      doSuccess(res.data);
    },
    fail: function () {
      doFail();
    },
  })
}

module.exports = {
  request
}